#include <bits/stdc++.h>
// 2025/02/06
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int t, n, m, p[101][101], dp[10001];

int DP(int d, int money){
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= n; i++)
        for (int j = p[d][i]; j <= money; j++)
            dp[j] = max(dp[j], dp[j - p[d][i]] + p[d + 1][i] - p[d][i]);
    int ans = 0;
    for (int i = 1; i <= money; i++)
        ans = max(ans, dp[i]);
    return ans + money;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cin >> t >> n >> m;
    for (int i = 1; i <= t; i++)
        for (int j = 1; j <= n; j++)
            cin >> p[i][j];
    for (int i = 1; i < t; i++)
        m = DP(i, m);
    cout << m << endl;
    return 0;
}